1 Conflict Across South Sudan

ACLED’s conflict event data from South Sudan dates from July 14, 2011 and goes through December 2, 2021. It includes 7,939 unique conflict events.

#A map of the country with all conflict events plotted
ggplot(data = neighbors)+
  geom_sf(fill = "#F8F0E3") +
    geom_sf_label(data = neighbors
                , aes(label = shapeName)) +
  geom_sf(data = states,
          color = "white") +
  geom_sf(data = events_sf
          , aes(color = event_type)
          , alpha = .3)+
  geom_sf_text(data = states
                , aes(label = shapeName)
                , color = "#565656") +
  geom_sf(data = SSudan
          , color = "#000000"
          , width = 4
          , fill = NA) +
  geom_sf(data = places_SS)+
  geom_sf_text(data = places_SS
                , aes(label = NAME_ID)
                , nudge_x = .2
                , nudge_y = -.1
                , check_overlap = T
                , color = "#000000")+
  geom_sf(data = water
          , color = "steel blue"
          , width = 4) +
  geom_sf(data = lakes
          , color = "steel blue"
          , width = 10)+
  coord_sf(xlim = c(24.15331, 35.94900)
           , ylim = c(3.248898, 12.23631))+
  theme.plot()+
  labs(title = "South Sudan"
         , subtitle = ""
         , caption = "Author: Brian Calhoon; Sources: rgeoboundaries, rnaturalearth"
       , x = ""
       , y = "")+
  theme(axis.text = element_blank())
Conflict events in South Sudan since its inception as a country.

Figure 1.1: Conflict events in South Sudan since its inception as a country.

a <-st_join(SS_admin, events_sf, left = T)

#Choropleth map of counties and conflict
a %>% 
  group_by(shapeName) %>% 
  summarize(attacks = log1p(sum(!is.na(event_id_cnty)))) %>% 
  tmap::tm_shape() +
  tmap::tm_polygons('attacks', title = 'ACLED\nevents (logged)'
                    , style = "cont"
  #, palette = cont_pal
  , border.col = "white") +
  tmap::tm_shape(states)+
  tmap::tm_borders(col = "white"
             , lwd = 2)+
  tmap::tm_shape(st_union(a)) +
  tmap::tm_borders(col = "black"
             , lwd = 2)+
  tmap::tm_layout(main.title = "Concentration of Conflict in South Sudan, 2011 - 2021"
                  , fontfamily = "Corbel"
                  , legend.outside.position = "bottom"
                  , legend.position = c(0,0)) +
  tmap::tm_credits("Source: ACLED")

a <- a %>%  
  group_by(shapeName, year) %>% 
  summarize(attacks = log1p(sum(!is.na(event_id_cnty))))

tmap::tmap_mode("plot")+
  tmap::tm_shape(a
                 , is.master = T) +
  tmap::tm_polygons("attacks"
                    , title = "ACLED\nevents (logged)"
                    , border.col = "grey"
                    , style = "cont") +
  tmap::tm_facets("year") + 
  tmap::tm_shape(st_union(a))+
  tmap::tm_borders(col = "black")+
  tmap::tm_layout(main.title = "Conflict Concentration by Year, 2011 - 2021"
                  , legend.outside.position = "bottom", legend.position = c(.8, 1.1))
Conflict varies over time across South Sudan. With events concentrating over time in Central Equatoria.

Figure 1.2: Conflict varies over time across South Sudan. With events concentrating over time in Central Equatoria.

2 An interactive map

Below is a map that you can explore for yourself. If you hover over one of the dots a label will appear, and if you click on it additional information about the event will appear.

tmap::tmap_mode("view")
tmap::tm_basemap(c(StreetMap = "OpenStreetMap",
             TopoMap = "OpenTopoMap")) +
  tmap::tm_tiles(c(TonerHybrid = "Stamen.TonerHybrid"))+
  tmap::tm_shape(events_sf, is.master = TRUE) + 
  tmap::tm_dots(col = "event_type"
          , id = "event_type"
          , popup.vars=c("Event date" = "event_date"
                         , "Sub-event Type"="sub_event_type"
                         , "Actors"= "actor1"
                         , "Fatalities" = "fatalities"
                         , "Sources" = "source")
          , popup.format=list() 
          , group = "Events"
          , alpha = .3
          , palette = my_pal)

Now that we have a count of the types of conflict, let’s look at the which types are occurring in which states.

#Here we're going to map 6 plots. So, I iterate over a list of six ggplots using purr::map()

#My type vector
type <- unique(events$event_type)

#My function for filtering by type
type_fun <- function(x){
  events %>% 
    filter(event_type == {{x}}) %>% 
    group_by(admin1, event_type) %>% 
    summarize(Count = n())
}

#Now run it for real
z <-map(type, ~type_fun(.x))

#Plot the object and organize it by Count. The facet_wrap function generates six charts, one for each of the event types
plot_fun <- function(x) {
  ggplot(x
         , aes(Count, reorder(admin1, Count)
               , color = admin1
               , fill = admin1)) +
    geom_point(size = 5
               , alpha = .3) +
    geom_text(aes(label = Count)
              , color = "#000000") +
    theme.plot() +
    theme(legend.position = "none"
          , axis.text.x = element_blank())+
    ggtitle(x[[2]]) +
    labs(x = ""
         , y = "")
  
}

six_plot <- map(z, ~plot_fun(.x))

#This works
plot_row <- cowplot::plot_grid(plotlist = six_plot
                               , nrow = 3
                               , ncol = 2
                               , label_size = 14
                               , label_fontface = "plain"
                               , label_fontfamily = "Corbel")

title <- ggdraw() + 
  cowplot::draw_label(
    "Types of Conflict Events"
    , fontface = 'plain'
    , fontfamily = "Corbel"
    , size = 26
    , x = 0
    , hjust = 0
  ) +
  theme(
    # add margin on the left of the drawing canvas,
    # so title is aligned with left edge of first plot
    plot.margin = margin(0, 0, 0, 7)
  )

caption <- ggdraw() +
  cowplot::draw_label("Source: ACLED, www.acleddata.com"
             , fontface = "plain"
             , fontfamily = "Corbel"
             , size = 10
             , hjust = -.5)

plot_grid(
  title, plot_row, caption,
  ncol = 1,
  # rel_heights values control vertical title margins
  rel_heights = c(0.1, 1)
)

events_state <- events %>% 
  group_by(admin1) %>% 
  summarize(Count = n()) 

#Plot the object and organize it by Count
ggplot(events_state
       , aes(Count, reorder(admin1, Count)
       , color = admin1
       , fill = admin1
       , alpha = .3)) +
  geom_point(size = 14) +
  geom_text(aes(label = Count)
            , color = "#000000") +
  theme.plot() +
  ggtitle("Conflict Events by State"
       , subtitle="The majority of conflict has occurred in four states:\n Central Equatoria, Jonglei, Unity, and Upper Nile") +
       labs(x = ""
       , y = ""
       ,caption = "Source: ACLED, www.acleddata.com") +
  theme(legend.position = "none")

The most common types of conflict are:

#Make an object that groups events by event_type
events_type <- events %>% 
  group_by(event_type) %>% 
  summarize(Count = n()) 

#Plot the object and organize it by Count
ggplot(events_type
       , aes(Count, reorder(event_type, Count)
             , color = event_type))+
  geom_point(size = 14
             , alpha = .3) +
  geom_text(aes(label = Count)
            , color = "#000000") +
  theme.plot() + 
  theme(legend.position = "none"
      , axis.text.x = element_blank()
      , axis.title.y = element_blank())+
  ggtitle("Conflict Event Types in South Sudan, 1997-2021"
       , subtitle = "Battles and Violence Against Civilians are the Most Frequent Conflict Events")+
  labs(y = ""
       , x = ""
       , caption = "Source: ACLED, www.acleddata.com")

#My type vector
actor1 <- unique(events$actor1)

actor2 <- unique(events$actor2)

#actors in actor2 that are not in actor1
diff <- unique(actor2[!actor2 %in% actor1])

#How many of these were only involved in 1 event
actor_single <- events %>% 
  group_by(actor1) %>% 
  summarize(Count = n()) %>% 
  filter(Count == 1)

#How many of these were involved in more than 5 events
actor_mult <- events %>% 
  group_by(actor1) %>% 
  summarize(Count = n()) %>% 
  filter(Count >5)

#How many of these were only involved in 1 event
actor_single2 <- events %>% 
  group_by(actor2) %>% 
  summarize(Count = n()) %>% 
  filter(Count == 1)

#How many of these were involved in more than 5 events
actor_mult2 <- events %>% 
  group_by(actor2) %>% 
  summarize(Count = n()) %>% 
  filter(Count >5)

Who is engaged in the conflicts? There are 525 unique conflict actors identified in the dataset. We’re going to look at which groups have been most active over the past five years and past year.

#actors with more than five events in past 5 years
actors_5y <- events %>%
  filter(year > 2015) %>% 
  group_by(actor1) %>% 
  summarize(Count = n()) %>% 
  filter(Count >5)

actors_5y2 <- events %>%
  filter(year > 2015) %>% 
  group_by(actor2) %>% 
  summarize(Count = n()) %>% 
  filter(Count >5)

#join the two objects together to have a single list of actors
join_5y <- full_join(actors_5y, actors_5y2) 

#Then aggregate the duplicate entries for 5 years
actors_5y_agg <- aggregate(Count ~ actor1, join_5y, sum)

#repeat for 1 year of actors
actors_1y <- events %>%
  filter(event_date > 2020-12-02) %>% 
  group_by(actor1) %>% 
  summarize(Count = n()) %>% 
  filter(Count >5)

actors_1y2 <- events %>%
  filter(event_date > 2020-12-02) %>% 
  group_by(actor2) %>% 
  summarize(Count = n()) %>% 
  filter(Count >5)

join_1y <- full_join(actors_1y, actors_1y2) 
  
actors_1y_agg <- aggregate(Count ~ actor1, join_1y, sum)